package com.zhu.day.exception;


import com.zhu.day.enums.ExceptionCode;

/**
 * Created by IntelliJ IDEA.
 * User: zhuhongqiang
 * Create: 2018/11/15 19:49
 */

public class ResultException extends RuntimeException {

    private static final long serialVersionUID = 132L;
    private String messages;
    private int code;

    public ResultException(ExceptionCode responseCode) {
        this.code = responseCode.getCode();
        this.messages = responseCode.getMessage();
    }

    public ResultException(ExceptionCode responseCode, String message) {
        this(responseCode, message, (Throwable)null);
    }

    public ResultException(ExceptionCode responseCode, String message, Throwable t) {
        super(t);
        this.code = responseCode.getCode();
        this.messages = message;
    }

    public ResultException(int code, String message) {
        this.code = code;
        this.messages = message;
    }
    public String getMessage() {
        return this.messages;
    }

    public int getCode() {
        return this.code;
    }

}
